package com.wx.oauth.config;

import com.wx.oauth.interceptor.WXOAuthInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Chenhaowen
 * @since 2019/8/5 20:57.
 */
@Configuration
public class Configurer implements WebMvcConfigurer {



    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        InterceptorRegistration registration = registry.addInterceptor(new WXOAuthInterceptor());
        registration.addPathPatterns("/**");
        registration.excludePathPatterns("/qrcode/**");
        registration.excludePathPatterns("/oauth/auth");
        registration.excludePathPatterns("/oauth/handler");
    }
}
